package com.carkeeper.feign;

import com.carkeeper.entity.Result;
import com.carkeeper.pojo.Blog;
import com.carkeeper.pojo.BlogCategory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Repository
@FeignClient(name = "discover-manage")
public interface BlogFeign {


    /**
     * 多条件查询
     *
     * @param map
     * @return
     */
    @GetMapping("/discover/multipartFind")
    public Result<List<Blog>> multipartConditionFind(@RequestParam Map map);


    /**
     * 查询全部分类
     *
     * @return
     */
    @GetMapping("/discover/findAllCategory")
    public Result<List<BlogCategory>> findAllCategory();


    /**
     * 添加文稿
     *
     * @param map
     * @return
     */
    @PostMapping("/discover/addBlog")
    public Result addBlog(@RequestBody Map<String, String> map);


    /**
     * 查询分类对应的配件或服务详情
     *
     * @param type
     * @return
     */
    @GetMapping("/discover/findKnowledgeByCategory/{type}")
    public Result findKnowledgeByCategory(@PathVariable("type") String type);


    /**
     * 根据id查询文稿详情
     *
     * @param id
     * @return
     */
    @GetMapping("/discover/findBlogById/{id}")
    public Result<Blog> findBlogById(@PathVariable("id") String id);


    /**
     * 修改文稿
     *
     * @param id
     * @return
     */
    @PutMapping("/discover/update/{id}")
    public Result update(@PathVariable("id") String id);
}
